-- CALC_HIDE_STRONGBOX_BOX
-- 隐藏的保险箱

return function(user, bonus_arg)
    -- 40%概率获得：金币×10000
    -- 30%概率获得：金币×20000
    -- 30%概率获得：钻石+3（限3次）

    local rand = DungeonM.getRandSeed("CALC_HIDE_STRONGBOX_BOX") % 100;

    local limit_rule = "";
    local limit_times;

    if type(bonus_arg) == "table" and type(bonus_arg["limit_rule"]) == "string" then
        limit_rule = bonus_arg["limit_rule"];
        limit_times = tonumber(bonus_arg["limit_times"]);
    end

    -- 30%概率钻石
    if rand < 30 and BuildingBonusM.getFieldStat(limit_rule) < limit_times then
        return { 2, "gem", 3, };
    elseif rand < 70 then
        return { 2, "money", 20000, };
    else
        return { 2, "money", 10000, };
    end
end
